#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Action.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class InputPin;

/// <summary>
/// RaiseExceptionAction
/// A RaiseExceptionAction is an Action that causes an exception to occur. The input
/// value becomes the exception object.
/// </summary>
class UMLMODEL_EXPORT RaiseExceptionAction : public Action {

public: // Constructors and destructors
    explicit RaiseExceptionAction(const QString& umlType="uml::RaiseExceptionAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// exception getter
    /// An InputPin whose value becomes the exception object.
    /// </summary>
    shared_ptr<InputPin> exception() const;

    /// <summary>
    /// exception setter
    /// An InputPin whose value becomes the exception object.
    /// </summary>
    void setException(shared_ptr<InputPin> value);

private: // Fields
    /// <summary>
    /// exception
    /// An InputPin whose value becomes the exception object.
    /// </summary>
    shared_ptr<InputPin> exception_;

};

} // namespace uml
